TOPDIR = $(shell pwd)

# --------------------------------------------------
#CXX = g++
CXX = ~/bin/gfilt
CC  = gcc
LD  = g++

CFLAGS = -c
INCDIR = -I
DEBUG = -Wall -DDEBUG -g #-pg
DEBUGCC = -Wall -g #-pg

# --------------------------------------------------

OBJS = 
TESTOBJS = String.o test.o

main: $(OBJS)
	$(LD) -o main $(OBJS)

%.o: %.cpp 
	$(CXX) $(DEBUG) $(CFLAGS) -c $^	

%.o: %.c
	$(CC) $(CFLAGS) -c $^


# --------------------------------------------------
#	     Test the unit function
# --------------------------------------------------
test: $(TESTOBJS)   
	$(LD) -o test $(TESTOBJS) 


.PHONY : clean 

clean:
	rm -rf $(OBJS) $(TESTOBJS) main test *~ ~*
	rm -rf *.o
	rm -rf core.*

# For flymake in Emacs
.PHONY: check-syntax
check-syntax:
	$(CXX) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
